package com.ruoyi.back.controller

import com.ruoyi.app.common.Data
import com.ruoyi.app.common.PageData
import com.ruoyi.app.common.pageInfo
import com.ruoyi.back.domain.ClubJob
import com.ruoyi.back.service.ClubJobService
import io.swagger.annotations.*
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("system/clubJob")
@Api(tags = ["系统设置-社友乐园"])
class ClubJobController {

    @Autowired
    private lateinit var clubJobService: ClubJobService


    @ApiOperation("保存社友乐园")
    @PostMapping("save")
    fun saveClubJob(@RequestBody clubJob: ClubJob): Data<Boolean> = clubJobService.saveClubJob(clubJob)

    @ApiOperation("获取社友乐园分页")
    @GetMapping("list")
    fun clubJobPage(clubJob: ClubJob): PageData<ClubJob> = clubJobService.clubJobPage(clubJob).pageInfo()

    @ApiOperation("批量移除社友乐园")
    @ApiImplicitParams(
        ApiImplicitParam(name = "clubJobIds", value = "社友乐园id 多个使用逗号", type = "path", required = true)
    )
    @PostMapping("remove/{clubJobIds}")
    fun removeClubJob(@PathVariable clubJobIds: String): Data<Boolean> = clubJobService.removeClubJob(clubJobIds)
}